//
// Unihan Input Method
//
// Copyright © 2002-2007 Sun Wah Linux Ltd.
//
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
// USA
//
// $Id: test1.c 757 2007-05-10 08:19:31Z roger $
//

/* FILE : test1.c */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <string.h>
#include <stdio.h>
#include <standard_im.h>

#include "IME.h"

IME_Functions imef = {
	IME_VERSION,
	IME_initialize,
	IME_finalize,
	IME_get_number_of_input_methods,
	IME_get_input_method_info,
	IME_create_input_context,
	IME_destroy_input_context,
	IME_process_key_event,
	IME_process_helper_event,
	IME_focus_in,
	IME_focus_out,
	IME_reset,
	IME_move_preedit_caret,
	IME_select_candidate,
	IME_previous_candidates_page,
	IME_next_candidates_page,
	IME_update_candidates_page_size,
	IME_trigger_property,
	IME_reload_config
};

IMM_Functions *immf = NULL;

IME_Bool
ime_register_module(const IMM_Functions *imm, IME_Functions *ime)
{
#if DEBUG
	fprintf(stderr, "STD IM TEST1 : ime register module\n");
#endif
	//*ime = &imef;
	ime->version = imef.version;
	ime->initialize = imef.initialize;
	ime->finalize = imef.finalize;
	ime->get_number_of_input_methods = imef.get_number_of_input_methods;
	ime->get_input_method_info = imef.get_input_method_info;
	ime->create_input_context = imef.create_input_context;
	ime->destroy_input_context = imef.destroy_input_context;
	ime->process_key_event = imef.process_key_event;
	ime->process_helper_event = imef.process_helper_event;
	ime->focus_in = imef.focus_in;
	ime->focus_out = imef.focus_out;
	ime->reset = imef.reset;
	ime->move_preedit_caret = imef.move_preedit_caret;
	ime->select_candidate = imef.select_candidate;
	ime->previous_candidates_page = imef.previous_candidates_page;
	ime->next_candidates_page = imef.next_candidates_page;
	ime->update_candidates_page_size = imef.update_candidates_page_size;
	ime->trigger_property = imef.trigger_property;
	ime->reload_config = imef.reload_config;
	immf = (IMM_Functions *)imm;
	return IME_TRUE;
}

// vi:ts=4:nowrap:cin:expandtab
